import request from '../../utils/request.js'
const state = {
	initData: {},
	indexData: {},
	cateList:[]
}
const getters = {}
const mutations = {
	changeIndexDataMutation(state, indexData) {
		state.indexData = indexData
	},
	changIndexCateListMutation(state,cateList){
		state.cateList = cateList
	}
	
}
const actions = {
	// 获取推荐页数据
	async getIndexDataAction({commit}) {
		const res = await request('/getIndexData', res)
		commit('changeIndexDataMutation',res)
	},
	//获取tab栏每个页面的数据
	async getIndexCateListAticon({commit}){
		const res = await request('/getindexCateList',res)
		commit('changIndexCateListMutation',res)
		return 123
	}
	
}
export default {
	namespaced: true, //支持命名空间
	state,
	getters,
	mutations,
	actions
}
